{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"Factor21\"]",
      "text/html": [
       "<ul><li>Factor21</li></ul>"
      ],
      "text/plain": [
       "Factor21"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open Microsoft.Quantum.Samples.IntegerFactorization2;\n",
    "\n",
    "operation Factor21(): (Int,Int){\n",
    "    return FactorSemiprimeInteger(21, false);\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "We have guessed a divisor of 21 to be 3 by accident.\n"
     ]
    },
    {
     "data": {
      "application/json": "{\"@type\":\"@tuple\",\"Item1\":3,\"Item2\":7}",
      "text/plain": [
       "(3, 7)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate Factor21"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Estimating period of 2\n",
      "The estimated frequency was 0, trying again.\n",
      "The estimated period from continued fractions failed, trying again.\n"
     ]
    },
    {
     "data": {
      "application/json": "{\"@type\":\"@tuple\",\"Item1\":7,\"Item2\":3}",
      "text/plain": [
       "(7, 3)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate Foo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"Microsoft.Quantum.Samples.IntegerFactorization.ApplyOrderFindingOracle\",\"Microsoft.Quantum.Samples.IntegerFactorization.EstimatePeriod\",\"Microsoft.Quantum.Samples.IntegerFactorization.FactorInteger\",\"Microsoft.Quantum.Samples.IntegerFactorization2.ApplyOrderFindingOracle\",\"Microsoft.Quantum.Samples.IntegerFactorization2.EstimateFrequency\",\"Microsoft.Quantum.Samples.IntegerFactorization2.EstimatePeriod\",\"Microsoft.Quantum.Samples.IntegerFactorization2.FactorSemiprimeInteger\",\"Microsoft.Quantum.Samples.IntegerFactorization2.MaybeFactorsFromPeriod\",\"Microsoft.Quantum.Samples.IntegerFactorization2.PeriodFromFrequency\"]",
      "text/html": [
       "<ul><li>Microsoft.Quantum.Samples.IntegerFactorization.ApplyOrderFindingOracle</li><li>Microsoft.Quantum.Samples.IntegerFactorization.EstimatePeriod</li><li>Microsoft.Quantum.Samples.IntegerFactorization.FactorInteger</li><li>Microsoft.Quantum.Samples.IntegerFactorization2.ApplyOrderFindingOracle</li><li>Microsoft.Quantum.Samples.IntegerFactorization2.EstimateFrequency</li><li>Microsoft.Quantum.Samples.IntegerFactorization2.EstimatePeriod</li><li>Microsoft.Quantum.Samples.IntegerFactorization2.FactorSemiprimeInteger</li><li>Microsoft.Quantum.Samples.IntegerFactorization2.MaybeFactorsFromPeriod</li><li>Microsoft.Quantum.Samples.IntegerFactorization2.PeriodFromFrequency</li></ul>"
      ],
      "text/plain": [
       "Microsoft.Quantum.Samples.IntegerFactorization.ApplyOrderFindingOracle, Microsoft.Quantum.Samples.IntegerFactorization.EstimatePeriod, Microsoft.Quantum.Samples.IntegerFactorization.FactorInteger, Microsoft.Quantum.Samples.IntegerFactorization2.ApplyOrderFindingOracle, Microsoft.Quantum.Samples.IntegerFactorization2.EstimateFrequency, Microsoft.Quantum.Samples.IntegerFactorization2.EstimatePeriod, Microsoft.Quantum.Samples.IntegerFactorization2.FactorSemiprimeInteger, Microsoft.Quantum.Samples.IntegerFactorization2.MaybeFactorsFromPeriod, Microsoft.Quantum.Samples.IntegerFactorization2.PeriodFromFrequency"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%workspace reload"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Q#",
   "language": "qsharp",
   "name": "iqsharp"
  },
  "language_info": {
   "file_extension": ".qs",
   "mimetype": "text/x-qsharp",
   "name": "qsharp",
   "version": "0.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
